package export.magicWeapon
{
	import base.*;
	
	import com.game.data.vo.EquipmentVO;
	import com.greensock.*;
	
	import export.bullet.*;
	
	import flash.geom.*;
	
	public class MagicRing extends BaseMagicWeapon
	{
		
		public function MagicRing(param1:BaseHero)
		{
			super(param1);
			this.mp = 50;
		}
		
		override protected function initBBDC():void
		{
			var _loc1_:* = null;
			var _loc2_:Array = BaseBitmapDataPool.getBitmapDataArrayByName("MagicRingBmd");
			if (_loc2_)
			{
				_loc1_ = {
					"name"  : "body",
					"source": _loc2_
				};
				bbdc = new BaseBitmapDataClip([_loc1_], 100, 100, new Point(0, 0));
				bbdc.setOffsetXY(1, -10);
				bbdc.setFrameStopCount([[10], [9999]]);
				bbdc.setFrameCount([1, 1]);
				bbdc.setAddScriptWhenFrameOver(scriptFrameOverFunc);
				this.addChild(bbdc);
				return;
			}
			throw new Error("MagicRing--BitmapData Error!");
		}
		
		override public function showSkill():void
		{
			var lv:Number;
			var timeCount:uint = 0;
			var equip:EquipmentVO = null;
			var bb:SpecialEffectBullet = new SpecialEffectBullet("MagicRingEffect");
			bb.x = this.x;
			bb.y = this.y;
			bb.setDisable();
			bb.setOwner(this.sourceRole);
			bb.setAction("idle");
			this.sourceRole.magicBulletArray.push(bb);
			gc.gameScene.addChild(bb);
			timeCount = gc.frameClips * 2;
			equip = this.sourceRole.getPlayer().getCurEquipByType("zbfb");
			lv = equip.getLevel() * 0.00904;
			if (equip.getFiveElementString().indexOf("木") != -1)
			{
				lv *= 2;
				timeCount *= 1.5;
			}
			this.sourceRole.setInvincible(timeCount);
			this.sourceRole.cureHp(sourceRole.getHpMax() * lv);
			this.sourceRole.cureMp(sourceRole.getMpMax() * lv / 2);
			TweenMax.delayedCall(30, function (param1:MagicRing):*
			{
				param1.setAction("idle");
			}, [this]);
		}
	}
}
